From: Colin Walters Date: Thu, 20 May 2010 21:06:30 +0000 (-0400) Subject: [ShellAppSystem] Don't crash if the menu system is empty X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10060 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=2ce746e7dd64fc36b0767bd0551d2a6b7349a669;p=gnome-shell.git [ShellAppSystem] Don't crash if the menu system is empty This is a bit pathological, but if your menu tree is empty, we shouldn't crash. --- diff --git a/src/shell-app-system.c b/src/shell-app-system.c index ad8cef47d..faa960e55 100644 --- a/src/shell-app-system.c +++ b/src/shell-app-system.c @@ -309,9 +309,15 @@ reread_entries (ShellAppSystem *self, g_slist_free (*cache); *cache = NULL; - *cache = gather_entries_recurse (self, *cache, unique, trunk); - - gmenu_tree_item_unref (trunk); + if (!trunk) + { + *cache = NULL; + } + else + { + *cache = gather_entries_recurse (self, *cache, unique, trunk); + gmenu_tree_item_unref (trunk); + } } static void